package com.wanxi.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

/**
 * @author Li
 * @Date 2023/7/11 18:17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("permission")
public class PermissionModel implements GrantedAuthority {
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private String id;
    private Integer pid;
    private String permissionName;
    private String value;
    private String url;
    private Integer status;
    private String createTime;

    @Override
    public String getAuthority() {
        return this.value;
    }
}
